<?php
defined('IN_IXDCW') or exit('Access Denied');
include tpl('header');
show_menu($menus);
?>

<form action="?" method="post" id="dform">
    <input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/>
    <input type="hidden" name="file" value="<?php echo $file;?>"/>
    <input type="hidden" name="action" value="<?php echo $action;?>"/>
    <input type="hidden" name="itemid" value="<?php echo $itemid;?>"/>
    <input type="hidden" name="forward" value="<?php echo $forward;?>"/>
    <div class="tt"><?php echo $tname;?></div>
    <table cellpadding="2" cellspacing="1" class="tb">
        <!--标题信息-->
        <tr>
            <td class="tl"><span class="f_red">*</span> <?php echo $MOD['name'];?>标题</td>
	        <td><input name="post[title]" type="text" id="title" size="60" datatype="*2-999" nullmsg="请填写标题" errormsg="最少输入2个字符" value="<?php echo $title;?>"/> <?php echo level_select('post[level]', '级别', $level, 'id="level"');?></td>
        </tr>
        <!--关联车型目前在降价里面还没有实际作用-->
	    <tr id="carcatTr" >
		    <td class="tl"> <span class="f_hid">*</span>  关联车型</td>
            <!--品牌，车系，车款-->
		    <td class="tr">
			    <?php echo Post::autoCombo('post[arbid][]','post[arcid][]', 'post[amid][]', $item['arbid'],$item['arcid'],$item['amid'], 0, 0, 0) ;?>
		    </td>
	    </tr>
	    <tr>
		    <td class="tl"><span class="f_hid">*</span> 联系电话</td>
		    <td><input type="text" name="post[telephone]" id="tel"  value="<?php echo $telephone;?>" size="30"/> </td>
	    </tr>

	    <tr>
		    <td class="tl"><span class="f_hid">*</span> 联系地址</td>
		    <td><input name="post[address]" type="text" size="60"  value="<?php echo $address;?>"/></td>
	    </tr>
        <!--厂家名称-->
        <tr>
            <td class="tl"><span class="f_hid">*</span> 厂家名称</td>
            <td><input name="post[truename]" type="text" size="60"  value="<?php echo $truename;?>"/></td>
        </tr>
        <!--降价开始时间-->
        <tr>
            <td class="tl"><span class="f_hid">*</span> 开始时间</td>
            <td><?php echo Post::datetimeBox('post[starttime]',date('Y-m-d',$starttime) , 'width:140'); ?></td>
        </tr>
        <!--现价-->
        <tr id='price' style=''>
            <td class="tl"><span class="f_hid">*</span> (原)售价</td>
            <td><input name="post[price]" type="text" id="price" size="6" value="<?php echo $price;?>"/> 万<?php echo $DT['money_unit'];?></td>
        </tr>
        <!--优惠价（指导价）-->
        <tr>
            <td class="tl"><span class="f_hid">*</span> 优惠价(现价)</td>
            <td><input name="post[favorableprice]" type="text" size="6"  value="<?php echo $favorableprice;?>"/> 万<?php echo $DT['money_unit'];?></td>
        </tr>

        <!--降价结束时间-->
        <tr>
            <td class="tl"><span class="f_hid">*</span> 结束时间</td>
            <td><?php echo Post::datetimeBox('post[endtime]',date('Y-m-d',$endtime) , 'width:140'); ?></td>
        </tr>

	    <tr>
		    <td class="tl"><span class="f_red">*</span> 所属地区</td>
		    <td><?php echo ajax_area_select('post[areaid]', '请选择', $areaid);?> <span id="dareaid" class="f_red"></span></td>
	    </tr>
        <tr id="link" style="display:<?php echo $islink ? '' : 'none';?>;">
            <td class="tl"><span class="f_red">*</span> 链接地址</td>
            <td><input name="post[linkurl]" type="text" id="linkurl" size="60" value="<?php echo $linkurl;?>"/> <span id="dlinkurl" class="f_red"></span></td>
        </tr>
        <tbody id="basic" style="display:<?php echo $islink ? 'none' : '';?>;">
        <tr>
            <td class="tl"><span class="f_red">*</span> <?php echo $MOD['name'];?>内容</td>
	        <td><?php echo Post::kindEditor('post[content]', $moduleid, $content, 'datatype="*5-99999" nullmsg="请填写内容" errormsg="内容最少5字"','800px'); ?></td>
        </tr>
	    </tbody>
        <tr>
            <td class="tl" height="30"><span class="f_hid">*</span> 内容选项</td>
            <td>
                <input type="checkbox" name="post[save_remotepic]" value="1"<?php if ($MOD['save_remotepic']) echo 'checked';?>/>下载远程图片&nbsp;&nbsp;
                <input type="checkbox" name="post[clear_link]" value="1"<?php if ($MOD['clear_link']) echo 'checked';?>/>清除链接&nbsp;&nbsp;
                截取内容 <input name="post[introduce_length]" type="text" size="2" value="<?php echo $MOD['introduce_length']?>"/> 字符至简介&nbsp;&nbsp;
                设置内容第 <input name="post[thumb_no]" type="text" size="2" value=""/> 张图片为标题图
            </td>
        </tr>

        <tr>
            <td class="tl"><span class="f_hid">*</span> 关键词(Tag)</td>
            <td><input name="post[keyword]" type="text" size="60" value="<?php echo $tag;?>"/><?php tips('多个关键词请用空格隔开');?></td>
        </tr>
        <tr>
            <td class="tl"><span class="f_hid">*</span> <?php echo $MOD['name'];?>状态</td>
            <td>
                <input type="radio" name="post[status]" value="3" <?php if ($status == 3) echo 'checked';?> id="status_3"/><label for="status_3"> 通过</label>
                <input type="radio" name="post[status]" value="2" <?php if ($status == 2) echo 'checked';?> id="status_2"/><label for="status_2"> 待审</label>
                <input type="radio" name="post[status]" value="1" <?php if ($status == 1) echo 'checked';?> onclick="if(this.checked) Dd('note').style.display='';" id="status_1"/><label for="status_1"> 拒绝</label>
                <input type="radio" name="post[status]" value="0" <?php if ($status == 0) echo 'checked';?> id="status_0"/><label for="status_0"> 删除</label>
            </td>
        </tr>
        <tr id="note" style="display:<?php echo $status == 1 ? '' : 'none';?>">
            <td class="tl"><span class="f_red">*</span> 拒绝理由</td>
            <td><input name="post[note]" type="text" size="40" value="<?php echo $note;?>"/></td>
        </tr>
        <tr>
            <td class="tl"><span class="f_hid">*</span> 添加时间</td>
	        <td><?php echo Post::datetimeBox('post[addtime]', $addtime, 'width:140'); ?></td>
        </tr>
	    <!--
        <tr>
            <td class="tl"><span class="f_hid">*</span> 浏览次数</td>
            <td><input name="post[hits]" type="text" size="10" value="<?php echo $hits;?>"/></td>
        </tr>
        -->
    </table>
    <div class="sbt"><input type="submit" name="submit"  value=" 确 定 " class="btn"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="reset" value=" 重 置 " class="btn"/></div>
    <!--当前页面提交到了price/admin/index.inc.php对应的方法。其他页面雷同-->
</form>
<script type="text/javascript">
	seajs.use(['$', 'vf', 'vf-css', 'easyui','easyui-css'], function($){
		$('#dform').Validform({
			beforeCheck:function(curform){
				lemon.editor.post_content_.sync();
			}
		});
	});
	function TopUse(a) {
		mkDialog('', '<iframe src="?moduleid=<?php echo $moduleid;?>&action='+a+'" width="650" height=250" border="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" framespacing="0" frameborder="0" scrolling="yes"></iframe>', '请选择', 675, 0, 0);
	}
</script>
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
<?php include tpl('footer'); ?>